<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=7" />
        <title>后台管理中心</title>
        <?php echo $this->_var['system_css']; ?>
        <?php echo $this->_var['system_js']; ?>
        <script type="text/javascript">
            $(function(){
                
                $("#myform").validate({
                    rules: {
                        name: "required",
                        url:{
                            required:true,
                            url:true
                        }
                    },
                    messages: {
                        name: "广告名称不能为空",
                        url:{
                            required:"广告链接不能为空",
                            url:"链接格式不对,例如：http://www.9393915.com"
                        }
                    }
                });
            })
        </script>
    </head>
    <body>
        <?php echo $this->fetch('message.html'); ?>
        <div class="pad-10">
            <div class="common-form">
                <form name="myform" action="#" method="post" id="myform" enctype="MULTIPART/FORM-DATA" >
                    <fieldset>
                        <legend>基本信息</legend>
                        <table width="100%" class="table_form">
                            <tr>
                                <td width="80"  class="red">广告名称</td> 
                                <td><input type="text" name="name"  class="input-text" id="name" size="50" value="<?php echo $this->_var['data']['name']; ?>"></input></td>
                            </tr>

                            <tr>
                                <td width="80"  class="red">广告位</td> 
                                <td><select name="category_id">
                                        <?php echo $this->_var['ads_category_list']; ?></select></td>
                            </tr>

                            <tr>
                                <td width="80"  class="red">广告跳转地址</td> 
                                <td><input type="text" name="url"  class="input-text" id="url" size="60" value="<?php echo $this->_var['data']['url']; ?>"></input></td>
                            </tr>

                            <tr>
                                <td width="80"  class="red">广告类型</td> 
                                <td><select name="ad_type">
                                        <option value="1" <?php if ($this->_var['data']['ad_type'] == 1): ?>selected='selected'<?php endif; ?>>图片类型</option>
                                        <option value="2" <?php if ($this->_var['data']['ad_type'] == 2): ?>selected='selected'<?php endif; ?>>文字类型</option></select>

                                </td>
                            </tr>

                            <tr>
                                <td  class="red">图片</td> 
                                <td><input type="file" name="file_name" id="file_name" /><img src="<?php echo $this->_var['data']['file_name']; ?>" width="100" height="100"></td>
                            </tr>

                            <tr>
                                <td>描述</td> 
                                <td> <textarea  style="width:50%;height:46px;"  name="description" value="<?php echo $this->_var['data']['description']; ?>"></textarea></td>
                            </tr>

                            <tr>
                                <td>排序</td>
                                <td>
                                    <input type="text" name="position" value="9999" class="input-text" size="10" value="<?php echo $this->_var['data']['position']; ?>"></input>
                                </td>
                            </tr>

                            <tr>
                                <td>点击次数</td>
                                <td>
                                    <input type="text" name="click"  class="input-text" size="10" value="<?php echo $this->_var['data']['click']; ?>"></input>
                                </td>
                            </tr>
                            <tr align="center">
                                <td colspan="2">
                                    <input type="submit" value="提交" name="dosubmit" class="button">
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
            </div>
        </div>


    </body>
</html>